package org.xhy.retryer.predicate;

/**
 * @description:
 * @gitee: https://gitee.com/XhyQAQ
 * @copyright: B站: https://space.bilibili.com/152686439
 * @Author: Xhy
 * @CreateTime: 2024-04-30 00:40
 */
public class ThrowsPredicate<T> implements IPredicate<T>{
    public final Class<? extends Throwable> throwable;

    public ThrowsPredicate(Class<? extends Throwable> throwable) {
        this.throwable = throwable;
    }

    @Override
    public boolean apply(T input) {
        return throwable.equals(input.getClass());
    }
}
